<template>
  <div class="card">
    <div class="card-header">
      <span>{{ title }}</span>
      <i class="el-icon-info" />
    </div>
    <div class="card-body">
      <div class="card-body-value">{{ value }}</div>
      <div class="card-body-item">
        <slot />
      </div>
    </div>
    <div class="card-footer">
      <slot name="footer" />
    </div>
  </div>
</template>

<script>
export default {
  name: 'Card',
  props: {
    title: {
      type: String,
      default: ''
    },
    value: {
      type: String,
      default: ''
    }
  }
}
</script>

<style lang="scss" scoped>
.card {
  padding: 20px;
  box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%);
  .card-header {
    color: #ccc;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
  }
  .card-body {
    padding: 10px 0 6px 0;
    border-bottom: 1px solid #f0f0f0;
    .card-body-value {
      font-size: 26px;
    }
    .card-body-item {
      height: 50px;
      font-size: 14px;
      display: flex;
      // 垂直方向的对齐方式
      align-items: flex-end;
    }
  }
  .card-footer {
    padding-top: 6px;
    font-size: 15px;
  }
}
</style>
